var app = getApp()

Page({
  data: {
    loginStatus: true,
    currentPage: 'mine',
    aliveCount: 0,
    form: {
       //邀请码
      childUserIdOrCode:'',
      appyUserId: app.userInfo.userId,
      relationType: 2,
      appyType: 1,
      inviteCodeFlag: 1
    }
  },
  handleInput(e){
    var form = this.data.form
    form.childUserIdOrCode = e.detail.value
    this.setData({
      form
    })
  },
  submit(){
    app.middleware.requestAjax({
      serAddr: app.serAddrs['qrcodeInvite'],
      data: this.data.form,
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success(res) {
        wx.showToast({
          title: '已发送申请',
          icon: 'none'
        })
      },
      fail(err){
        wx.showToast({
          title: err.msg,
          icon: 'none'
        })
      }
    })
  }
})
